<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html >
<html>
	<head>
		<%@ include file="/common/taglibs.jsp"%>
		<title>sinlog</title>
	</head>
	<body>
	<div class="mainContent">
		<div class="editDiv">
			<div class="editHead">
				<c:if test="${method == 'add'}">
					<span>新增参数类型</span>
				</c:if>
				<c:if test="${method == 'edit'}">
					<span>修改参数类型</span>
				</c:if>
				<c:if test="${method == 'view'}">
					<span>查看参数类型</span>
				</c:if>
			</div>
			<form class="editForm" action="#" method="post">
				<input type="hidden" name="paramType.typeId" value="${paramType.typeId}"/>
				<input type="hidden" name="method" value="${method}"/>
				<table width="100%">
					<tr>
						<td align="right">类型代码：</td>
						<td><input type="text" name="paramType.typeCode" value="${paramType.typeCode}" class="validate[required]"
							<c:if test="${method == 'edit'}">
								 readonly="readonly"
							</c:if>/>
						</td>
					</tr>
					<tr>
						<td align="right">类型名称：</td>
						<td><input type="text" name="paramType.typeName" value="${paramType.typeName}" class="validate[required]"/></td>
						
					</tr>
					<tr>
						<td colspan="2" align="center">
							<c:if test="${method != 'view'}">
								<a href="javascript:doSubmit();" class="button blue">提交</a>
							</c:if>
							<a href="javascript:doReturn();" class="button">返回</a>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
<script type="text/javascript">
	$(document).ready(function(){
		jQuery(".editForm").validationEngine();
	});
	function doSubmit(){
		var vali = $(".editForm").validationEngine('validate');
		if(!vali){
			return;
		}
		var data = $('.editForm').serialize();
		wait();
		Util.doAjaxPost('${ctx}/param!update.action',data,function(text){
			uwait();
			var ret = jQuery.parseJSON(text);
			if(ret.success){
				$.messager.confirm('系统提示','操作成功，是否现在返回列表？',function(r){
					if(r){
						openMenu('参数管理','${ctx}/param.action');
					}
				});
			}else{
				$.messager.alert('系统提示',ret.msg,'error');
			}
			
		});
	}
	function doReturn(){
		openMenu('参数管理','${ctx}/param.action');
	}

</script>
	</body>
</html>